Alphabet#456
Conversation
co-authored-by: Codex OpenAI <codex@openai.com>
There was a problem hiding this comment.
Other than some small comments, this looks good to me! Thanks @james-d-mitchell
| rg = ReportGuard(False) | ||
| yield | ||
| del rg |
There was a problem hiding this comment.
| rg = ReportGuard(False) | |
| yield | |
| del rg | |
| return ReportGuard(False) |
?
There was a problem hiding this comment.
Whilst looking into this, I realised our doctest reporting suppression hasn't been working. I think the fix is
# Python code that is treated like it were put in a testsetup directive for
# every file that is tested, and for every group.
doctest_global_setup = """from libsemigroups_pybind11 import ReportGuard
-ReportGuard(False)"""
+rg = ReportGuard(False)"""in line 192 of docs/source/conf.py.
If you make the pytest change above, please could you make the doctest one too. Thank you
There was a problem hiding this comment.
Suggested change
rg = ReportGuard(False) yield del rg return ReportGuard(False) ?
I don't think this works, due to the lifetime of the ReportGuard ending before the tests are run. I might be wrong, but I tried a number of different things here and this one works. The del is unnecessary but stops the linter from complaining about rg being unused so I left it in
There was a problem hiding this comment.
Whilst looking into this, I realised our
doctestreporting suppression hasn't been working. I think the fix is# Python code that is treated like it were put in a testsetup directive for # every file that is tested, and for every group. doctest_global_setup = """from libsemigroups_pybind11 import ReportGuard -ReportGuard(False)""" +rg = ReportGuard(False)"""in line 192 of
docs/source/conf.py.If you make the
pytestchange above, please could you make thedoctestone too. Thank you
I did this already 😀
| :sig=(self: Alphabet, *, word: type) -> None: | ||
| ::only-document-once: | ||
| Default constructor. | ||
| This function constructs an empty alphabet. |
There was a problem hiding this comment.
This is not a default constructor because it has a parameter.
No description provided.